import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text("Transform Widget Demo"),
      ),
      body: ClipWidget(),
    ),
  ));
}

class ClipWidget extends StatelessWidget {
  const ClipWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    Widget avatar  =Image.asset("assets/images/avatar.png", width: 60.0,);
    return Center(
      child: Column(
        children: [
          avatar,
          ClipOval(child: avatar,),
          ClipRRect(
            borderRadius: BorderRadius.circular(5.0),
            child: avatar,
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Align(
                alignment: Alignment.topLeft,
                widthFactor: .5,
                child: avatar,
              ),
              const Text("你好世界", style: TextStyle(color: Colors.green),)
            ],
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ClipRRect(
                child: Align(
                  alignment: Alignment.topLeft,
                  widthFactor: .5,
                  child: avatar,
                ),
              ),
              const Text("你好世界", style: TextStyle(color: Colors.green),)
            ],
          ),
        ],
      ),
    );

  }
}
